// *************************************************************************************************
//
// MK3D Engine
// --------------------------------------
// Copyright (C) 2007-2011 Zeb (mailto: zebbey@gmail.com)
//
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
//
// *************************************************************************************************

#ifndef __H_MK_UI_MANAGER__
#define __H_MK_UI_MANAGER__

#include "mk_ui_window.h"
#include "mk_ui_static.h"
#include "mk_ui_button.h"
#include "mk_ft_font.h"
#include "mk_ui_edit_box.h"

namespace MK3DE
{
    class MK3DE_API CUIManager
    {
    public:
        CUIManager(CUIRenderer* renderer);
        ~CUIManager();

        BOOL Update(DWORD dt);
        BOOL Render();
        BOOL MsgProc(UIInputEvent& event);

        CUIStatic* AddStatic(CUIWindow* parent, D3DXVECTOR2& pos, D3DXVECTOR2& size, const char* name);
        CUIButton* AddButton(CUIWindow* parent, D3DXVECTOR2& pos, D3DXVECTOR2& size, const char* name);
        CUIEditBox* AddEditBox(CUIWindow* parent, D3DXVECTOR2& pos, D3DXVECTOR2& size, const char* name);

        int AddFont(const char* fileName, BOOL bAntialiased, DWORD points);
        CFTFont* GetFont(int index);

        void PushUIEvent(UIEvent& event);
        BOOL PopUIEvent(UIEvent& event);

    public:
        CUIRenderer* _renderer;
        std::vector<CUIWindow*> _vecWindow;
        std::vector<CFTFont*> _vecFont;

        std::list<UIEvent> _uiEventQueue;
    };
};

#endif // __H_MK_UI_MANAGER__